//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
//#pragma comment(linker,"/STACK:33554432") /*32Mb*/
#define _CRT_SECURE_NO_DEPRECATE
#include<sstream>
#include<iostream>
#include<numeric>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<memory>
#include<string>
#include<vector>
#include<cctype>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
using namespace std;

typedef unsigned long long      ui64;
typedef long long               i64;
typedef	vector<int>             VI;
typedef	vector<bool>            VB;
typedef	vector<VI>              VVI;
typedef	vector<string>          VS;
typedef	pair<int,int>           PII;
typedef map<string,int>         MSI;
typedef set<int>                SI;
typedef set<string>             SS;
typedef map<int,int>            MII;
typedef	pair<double,double>     PDD;

#define PB                      push_back
#define MP                      make_pair
#define X                       first
#define Y                       second
#define FOR(i, a, b)            for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)           for(int i = (a) - 1; i >= (b); --i)
#define CLEAR(a, b)             memset(a, b, sizeof(a))
#define SZ(a)                   int((a).size())
#define ALL(a)                  (a).begin(), (a).end()
#define RALL(a)                 (a).rbegin(), (a).rend()
#define INF                     (2000000000)

#ifdef _DEBUG
#define eprintf(...) fprintf (stderr, __VA_ARGS__)
#else
#define eprintf(...) assert (true)
#endif

PII b[4];
bool cross(int i, int j) {
	return (b[i].X == b[j].X || b[i].Y==b[j].Y);
}

bool ok() {
	FOR(i,0,4)
		FOR(j,0,4) if( i!=j && b[i]==b[j] ) return false;
	VI R(4,-1);
	FOR(i,0,4) {
		FOR(j,i+1,4) {
			if( cross(i,j) ) {
				if( R[i]!=-1 )
					return false;
				R[i] = j;
				R[j] = i;
			}
		}
	}
	FOR(i,0,4)
		if( R[i]==-1 )
			return false;
	return true;
}

int main()
{
	PII a[4];
	FOR(i,0,4)
		cin >> a[i].X >> a[i].Y;

	memcpy(b,a,sizeof(a));
	int res = INF;
	PII c[4];
	FOR(i1,0,20) {
		FOR(j1,0,20) {
			FOR(i2,0,20) {
				FOR(j2,0,20) {
					b[0] = MP(i1+1,j1+1);
					b[1] = MP(i2+1,j2+1);
					if( ok() ) {
						int tres = 2;
						if( b[0]==a[0] ) tres--;
						if( b[1]==a[1] ) tres--;
						if( tres < res ) {
							memcpy(c,b,sizeof(b));
							res = tres;
						}
					}
					//b[0] = a[0];
					//b[1] = a[1];
				}
			}
		}
	}

	FOR(what,0,4) {
		memcpy(b,a,sizeof(a));
		FOR(i1,0,20) {
			FOR(j1,0,20) {
				b[what] = MP(i1+1,j1+1);
				if( ok() ) {
					int tres = 1;
					if( tres < res ) {
						memcpy(c,b,sizeof(b));
						res = tres;
					}
				}
			}
		}
	}


	//cout << "Changes : " << res << endl;
	FOR(i,0,4)
		printf("%d %d\n",c[i].X, c[i].Y);
    return 0;
}